<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>栅格</title>
    <style>
        .box1{
            display: inline-grid;
            background-color: yellow;
            grid-template-columns: 20px;
            grid-auto-rows: 30px;
        }
        div:nth-of-type(2){
            background-color: pink;
        }
        div:nth-of-type(4){
            background-color: pink;
        }
        div:nth-of-type(6){
            background-color: pink;
        }
    </style>
</head>
<body>
<div class="box1">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>